//
//  Notice.m
//  Realm-demo
//
//  Created by 小菜 on 17/5/8.
//  Copyright © 2017年 蔡凌云. All rights reserved.
//

#import <XCTest/XCTest.h>
#import <Realm/Realm.h>
#import "NoticeModel.h"

@interface Notice : XCTestCase

@property RLMNotificationToken *token;

@end

@implementation Notice

- (void)setUp {
    [super setUp];
    
//    RLMRealm *rlm = [RLMRealm defaultRealm];
//    self.token = [rlm addNotificationBlock:^(RLMNotification  _Nonnull notification, RLMRealm * _Nonnull realm) {
//        NSLog(@"接收到变更通知--%@",notification);
//    }];
    
//    RLMResults *res = [NoticeModel allObjects];
//    self.token = [res addNotificationBlock:^(RLMResults * _Nullable results, RLMCollectionChange * _Nullable change, NSError * _Nullable error) {
//        NSLog(@"xxxx-%@-%@",change.insertions,results);;
//    }];
}

- (void)tearDown {
    // Put teardown code here. This method is called after the invocation of each test method in the class.
    [super tearDown];
}

- (void)testExample {
//    NoticeModel *noticeM = [[NoticeModel alloc] initWithValue:@[@1,@"xcxxx"]];
//    RLMRealm *rlm = [RLMRealm defaultRealm];
//    [rlm transactionWithBlock:^{
//        [rlm addObject:noticeM];
//    }];
//    
//    RLMResults *res =  [NoticeModel objectsWhere:@"name = 'xcxxx'"];
//    [rlm transactionWithBlock:^{
//        [rlm deleteObject:res.firstObject];
//    }];
}

@end
